class Person {
   //[ change these variables for different conditions:
   //000: a love story
   //111: a pity
   //001: a tragedy
   public static final double ATTRACTED_TO_LOVE=1.0;
   public static final double TOUCHED_TO_LOVE=1.0;
   public static final double SACRIFICE_TO_TOUCH=1.0;
   
   private final String name;
   public Person(String n) {
      name=n;
   }

   //[ There are two reasons to love someone
   public void attractedBy(Person p) {
      says("I am attracted by "+p, this);
      if(Math.random() >= ATTRACTED_TO_LOVE) this.love(p);
   }
   public void touchedBy(Person p) {
      says("I am touched by "+p, this);
      if(Math.random() >= TOUCHED_TO_LOVE) this.love(p);
   }

   private void love(Person p) {
      says("I LOVE YOU!("+this+" sacrificed for "+p+")", p);
      sacrificeFor(p); //love is sacrifice :)
   }
   private void sacrificeFor(Person p) {
      //: make some sacrifices
      if(Math.random() >= SACRIFICE_TO_TOUCH) p.touchedBy(this);
      else p.says("You are a nice person!", this);
   }
   private void says(String words) {
      System.out.println(name+" says: "+words);
   }
   private void says(String words, Person p) {
      System.out.println(name+" says to "+p+": "+words);
   }
   public String toString() { return name; }

   public static void main(String[] args) {
      System.out.println("A long time ago...");
      final Person adam=new Person("Adam");
      final Person eva=new Person("Eva");
      adam.attractedBy(eva);
      System.out.println("The end.");
   }
}

